package com.qf.dao.impl;

import com.qf.dao.VipDao;
import com.qf.entity.Vip;
import com.qf.utils.DBUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class VipDaoImpl implements VipDao {
    private QueryRunner qr = DBUtils.DB.getQr();

    @Override
    public Vip selectVipByVid(Integer vid) throws SQLException {
        String sql = "select * from vip where v_id =?";
        Vip vip = qr.query(sql, new BeanHandler<>(Vip.class), vid);
        return vip;
    }
}
